<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,  initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <!--
    width=device-width;
    height=height-viewport;
    inital-scale=1.0初始缩放比例
    uer-scalable=no;用户是否可以手动缩放
    -->
    <link rel="stylesheet" href="__STATIC__/css/bootstrap.min.css" />
    <link rel="stylesheet" href="__STATIC__/css/normalize.css" />
    <link rel="stylesheet" href="__STATIC__/css/reg.css" />
    <title>注册</title>
</head>
<body>
<div class="head">
    <div class="title">注册</div>
</div>
<div class="close"><a href="account.html">×</a></div>
<div>
    <form id="form_reg" action="{:url('index/account/regSucess')}" method="post">
        <input type="text" name="name"  placeholder="名"/>
        <br>	<br>
        <input type="text" name="surn" placeholder="姓"/>
        <br>	<br>
        <input type="text" name="email"  placeholder="电子邮箱地址"/>
        <br>	<br>
        <input type="password" name="pwd" placeholder="密码" id="pwdqr" />
        <br>	<br>
        <input type="password" name="checkpwd" placeholder="请再次输入密码" />
        <br>	<br>
        <div class="">
            <p><input type="radio" name="list" value="1" checked>我已阅读并同意XXXX协议</p>
        </div>
        <input type="submit" value="注&nbsp&nbs册"  name="sub"  style="background-color: #000000; color: #fff;"/>
    </form>
    <div class="to_login">
        <span>已有账号?</span><a href="login.html"> 立刻登录</a>
    </div>
</div>
<script type="text/javascript" src="__STATIC__/js/jquery.js"></script>
<script type="text/javascript" src="__STATIC__/js/jquery.validate.js"></script>

<script type="text/javascript">
   $("#form_reg").validate({
       rules:{
            name:'required',
            surn:'required',
           email:{
                required:true,
                email:true,
           },
           pwd:{
                required:true,
                minlength:6,
                maxlength:12,
           },
           checkpwd:{
                equalTo:'#pwdqr',
           },
       },
       messages:{
             name:{
                 required:'名不得为空!',
             },
           surn:{
               required:'姓不得为空!',
           },
           email:{
               required:'邮箱不能为空',
               email:'你的邮箱输入有误',
           },
           pwd:{
               required:'密码不能为空',
           }
       },
   });

</script>
<script type="text/javascript" language="javascript">
    /*------判断radio是否有选中，获取选中的值--------*/
    $(function(){
        $("#btnSubmit").click(function(){
            var val=$('input:radio[name="sex"]:checked').val();
            if(val==null){
                alert("什么也没选中!");
                return false;
            }
            else{
                alert(val);
            }
            var list= $('input:radio[name="list"]:checked').val();
            if(list==null){
                alert("请选中一个!");
                return false;
            }
            else{
                alert(list);
            }
        });
    });
</script>

</body>
</html>
